﻿using DisconfClient;
using System;
using Ymatou.CommonService;

namespace Ymatou.Evaluate.Common
{
    public static class EvaluateConfig
    {
        /// <summary>
        /// 计数器AppId
        /// </summary>
        public static string CounterAppId
        {
            get
            {
                return AppSettingHelper.GetAppSetting("CounterAppId", "product_evaluate");
            }
        }

        /// <summary>
        /// 计数器好评数
        /// </summary>
        public static string CounterGood
        {
            get
            {
                return AppSettingHelper.GetAppSetting("CounterGood", "evaluate_good");
            }
        }

        /// <summary>
        /// 计数器中评数
        /// </summary>
        public static string CounterNormal
        {
            get
            {
                return AppSettingHelper.GetAppSetting("CounterNormal", "evaluate_normal");
            }
        }

        /// <summary>
        /// 计数器差评数
        /// </summary>
        public static string CounterBad
        {
            get
            {
                return AppSettingHelper.GetAppSetting("CounterBad", "evaluate_bad");
            }
        }

        /// <summary>
        /// 计数器有图数
        /// </summary>
        public static string CounterPic
        {
            get
            {
                return AppSettingHelper.GetAppSetting("CounterPic", "evaluate_pic");
            }
        }

        /// <summary>
        /// 计数器商品平均分
        /// </summary>
        public static string CounterScore
        {
            get
            {
                return AppSettingHelper.GetAppSetting("CounterScore", "evaluate_score");
            }
        }

        /// <summary>
        /// 单品页评价列表显示条数
        /// </summary>
        public static int FirstPageEvaluateCount
        {
            get
            {
                var firstPageEvaluateCount = 10;//默认10
                try
                {
                    firstPageEvaluateCount = ConfigManager.GetConfigValue("FirstPageEvaluateCount", 10);
                }
                catch (Exception ex)
                {
                    ApplicationLog.Error("FirstPageEvaluateCount配置错误", ex);
                }
                return firstPageEvaluateCount;
            }
        }
    }
}
